-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre-fill billing information on PayPal (work in progress) #204
Conversation
@BenSturmfels Does this get the billing info from Anyway I had opposite problem - I needed to get rid of the shipping info entirely. Here is the code: PetrDlouhy@360fbde |
Sends the BasePayment billing details to PayPal to avoid the customer having to re-enter the information they've already provided.
3c9080c
to
3128ed7
Compare
Codecov Report
@@ Coverage Diff @@
## master #204 +/- ##
==========================================
+ Coverage 79.92% 79.93% +0.01%
==========================================
Files 28 28
Lines 1783 1784 +1
Branches 212 212
==========================================
+ Hits 1425 1426 +1
Misses 251 251
Partials 107 107
Continue to review full report at Codecov.
|
a91ec57
to
179c7cd
Compare
for more information, see https://pre-commit.ci
I've now updated this patch to use the billing information on |
The idea behind this is pretty clear, and the implementation looks good.
I'm not using paypal right now, so I'm just wondering: are the payment fields (e.g.: `payment.billing_address_1`) mandatory? Or is it possible that it's `None` for some setups?
|
I'll do some testing and see how PayPal behaves when sending blanks/nulls. We may need to either need to cast to strings or conditionally not pass the address if it's not complete. I've rebased on master and deployed to production but found that #139 seems to completely break PayPal payments. :( |
I have tried this code, but I run into serveral PayPal errors when I had something misconfigured in the billing info: 'field': 'transactions[0].item_list.shipping_address',
'issue': 'The specified country requires a postal code' or 'The combination of country and city is invalid' or 'field': 'transactions[0].item_list.shipping_address.line1',
'issue': 'Must not be blank' Since the billing info is usually filled in by user, it makes it very brittle and several validations of user data are needed to make this work right. Also I don't think, that the information in your comment: # "shipping_address", the PayPal payment form labels it as "Billing
# address", hence we're passing the billing address. is correct. In my project, we don't need any of this, since we are selling subscribtion for 3D models with no physical shipping. 'application_context': {
'shipping_preference': 'NO_SHIPPING',
}, in the payment data. @BenSturmfels Can you please add some setting to the provider, that would set the |
I'm going to close this PR because we're no longer maintaining the system that used this patch. |
@BenSturmfels Which system is no longer maintained? The PayPal payments? Also @WhyNotHugo wanted to make table of backend maintenance statuses in #272. Is there some documentation regarding that? |
@PetrDlouhy don't panic! My comments only relate to this specific patch, not django-payments or the PayPal integration as a whole. We previously used this custom patch to django-payments in an online store based on Saleor. That online store is no longer running, so I won't be able to justify the time to further the patch to a point that it could be included in django-payments. |
I've had this patch running in production with Saleor for about a year and thought it might be useful to others. May not yet be suitable to merge.
Also handles blank phone number which would otherwise cause a baffling "400 Bad Request" from PayPal.(removed as not available onBasePayment
.Related to the possibly abandoned #132.